/* GUI CONVERTED from mrmpup1a.p (converter v1.75) Sun Aug 13 17:22:03 2000 */
/* mrmpup1a.p - MRP Processor - validate joint type for co-product      */
/* Copyright 1986-2000 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*V8:ConvertMode=Maintenance                                            */
/*J23R*/ /*V8:WebEnabled=No                                             */
/* REVISION: 8.5    LAST MODIFIED: 05/09/95     BY: emb *J045*          */
/* REVISION: 8.6    LAST MODIFIED: 03/05/98     BY: *J23R* Santhosh Nair */
/* REVISION: 9.1    LAST MODIFIED: 08/13/00     BY: *N0KR* myb           */


     define input parameter bom_code as character NO-UNDO.
     define input parameter site as character NO-UNDO.
     define output parameter joint_type as character NO-UNDO.

     define variable co-product as character initial "1" no-undo.
     define variable base-process as character initial "5" no-undo.

/*J23R* find ptp_det no-lock where ptp_part = bom_code and ptp_site = site no-error. */
/*J23R*/ for first ptp_det fields(ptp_joint_type ptp_part ptp_site)
/*J23R*/ no-lock where ptp_part = bom_code and ptp_site = site: end.
     if available ptp_det then do:
        if ptp_joint_type = base-process then joint_type = co-product.
     end.
     else do:
        /*J23R*find*/ for first pt_mstr
/*J23R*/     fields(pt_joint_type pt_part)
    no-lock where pt_part = bom_code /*no-error*/: end.
        if available pt_mstr then do:
           if pt_joint_type = base-process then joint_type = co-product.
        end.
     end.
